<?php

namespace App\Kuafu\Order\Enum;

use App\Kuafu\Base\Enum\BaseCodeEnum;

class OrderCodeEnum extends BaseCodeEnum
{
    public const ERR_ORDER_PARAM_VALID                      = 412001;
    public const ERR_ORDER_DB_ADD                           = 412002;
    public const ERR_ORDER_DB_SET                           = 412003;
    public const ERR_ORDER_DB_DEL                           = 412004;
    public const ERR_ORDER_DB_PATCH                         = 412005;
    public const ERR_ORDER_ID_NOT_EXIST                     = 412006;
    public const ERR_ORDER_ADD_ERROR                        = 412007;
    public const ERR_ORDER_NOT_EXIST                        = 412008;
    public const ERR_ORDER_PAY_METHOD_ERR                   = 412009;
    public const ERR_ORDER_HAS_PAYED                        = 412010;
    public const ERR_ORDER_HAS_BAR_PAYING                   = 412011;
    public const ERR_ORDER_TIME                             = 412012;
    public const ERR_ORDER_REFUND_MONEY_ERROR               = 412013;
    public const ERR_ORDER_TOKEN_DECRYPT                    = 412014;
    public const ERR_ORDER_CANNOT_RESERVE                   = 412015;
    public const ERR_DEFINE_TIME_NULL                       = 412016;
    public const ERR_ORDER_COUNT_MONTH_PRICE                = 412017;
    public const ERR_SHOW_TIME_TAB                          = 412018;
    public const ERR_SHOW_TIME_DURATION                     = 412019;
    public const ERR_ORDER_PAY_ERROR_STATUS                 = 412020;
    public const ERR_ORDER_DISH_MISS                        = 412021;
    public const ERR_ORDER_SHOP_STATUS_IS_NOT               = 412022;
    public const ERR_ORDER_SHOP_APPLET_STATUS_IS_NOT        = 412023;
    public const ERR_ORDER_SHOP_CASH_REGISTER_STATUS_IS_NOT = 412024;
    public const ERR_ORDER_UPDATE_ERROR_LOCKED              = 412025;
    public const ERR_ORDER_CHECK_COUPON_LOCKED              = 412026;
    public const ERR_ORDER_CANCEL_STATUS                    = 412027;
    public const ERR_ORDER_CALL_PAY                         = 412028;
    public const ERR_ORDER_NO_ENOUGH_GIFT_PRODUCT           = 412029;

    // 412042 - 412061 留给 离线订单
    public const ERR_ORDER_OFFLINE_ORDER_EXIST = 412042;
    public const ERR_ORDER_OFFLINE_SIGN_ERROR  = 412043;
    public const ERR_ORDER_OFFLINE_PRICE_ERROR = 412044;

    // 412062 - 412100 留给 小程序下单
    public const ERR_POS_OFFLINE_STATUS = 412062;


    public const ERR_ORDER_REQUEST_BUSY    = 512001;
    public const ERR_ORDER_STATIC          = 512002;
    public const ERR_ORDER_SOURCE_TYPE_WM  = 512003;
    public const ERR_ORDER_IN_OUT_TYPE     = 512004;
    public const ERR_STAT_TYPE             = 512005;
    public const ERR_ORDER_IN_OUT_TYPE_ONE = 512006;
    public const ERR_QUERY_TIME            = 512007;


    const CODE_TEXT = [
        self::ERR_ORDER_PARAM_VALID                      => "参数校验错误",
        self::ERR_ORDER_PAY_ERROR_STATUS                 => "支付状态异常, 不允许下单",
        self::ERR_ORDER_DB_ADD                           => "订单支付失败",
        self::ERR_ORDER_DB_SET                           => "编辑失败",
        self::ERR_ORDER_DB_DEL                           => "删除失败",
        self::ERR_ORDER_DB_PATCH                         => "上下架失败",
        self::ERR_ORDER_ID_NOT_EXIST                     => "订单不存在",
        self::ERR_ORDER_ADD_ERROR                        => "下单失败",
        self::ERR_ORDER_NOT_EXIST                        => "订单信息不存在",
        self::ERR_ORDER_PAY_METHOD_ERR                   => "订单支付方式不存在",
        self::ERR_ORDER_HAS_PAYED                        => "订单已支付",
        self::ERR_ORDER_HAS_BAR_PAYING                   => "该订单正在支付",
        self::ERR_ORDER_UPDATE_ERROR_LOCKED              => "该订单正在处理中，请稍后再请求支付。",
        self::ERR_ORDER_CHECK_COUPON_LOCKED              => "此券正在核销中，请稍后再试。",
        self::ERR_ORDER_TIME                             => "结束时间要大于开始时间",
        self::ERR_ORDER_REFUND_MONEY_ERROR               => "退款金额有误",
        self::ERR_ORDER_TOKEN_DECRYPT                    => "解密数据错误",
        self::ERR_ORDER_CANNOT_RESERVE                   => "订单不能反结账",
        self::ERR_DEFINE_TIME_NULL                       => "自定义时间段未传入时间",
        self::ERR_ORDER_COUNT_MONTH_PRICE                => "月收入查询失败",
        self::ERR_SHOW_TIME_TAB                          => "错误的showTimeTab",
        self::ERR_SHOW_TIME_DURATION                     => '查询时间范围不能超过1个月',
        self::ERR_ORDER_DISH_MISS                        => '菜品缺失',
        self::ERR_ORDER_SHOP_STATUS_IS_NOT               => '门店暂停营业, 请勿下单',
        self::ERR_ORDER_SHOP_APPLET_STATUS_IS_NOT        => '小程序下单渠道暂时被关闭',
        self::ERR_ORDER_SHOP_CASH_REGISTER_STATUS_IS_NOT => '亲爱的夸父伙伴，您的违约信息已过期， 目前己暂停订货和收银通道，请进入夸父商家APP完成处理。感谢您的理解！',

        self::ERR_ORDER_REQUEST_BUSY    => "您的请求太频繁啦，请稍后再试~",
        self::ERR_ORDER_STATIC          => "统计服务繁忙，请稍后再试",
        self::ERR_ORDER_SOURCE_TYPE_WM  => "不支持的外卖sourceType",
        self::ERR_ORDER_IN_OUT_TYPE     => '错误的店内外订单类型',
        self::ERR_STAT_TYPE             => '错误的statisticsType',
        self::ERR_ORDER_IN_OUT_TYPE_ONE => '当前接口仅支持orderType=1/2',

        self::ERR_ORDER_OFFLINE_ORDER_EXIST => '离线订单号已存在，请联系对应管理人员。',
        self::ERR_ORDER_OFFLINE_SIGN_ERROR  => '离线订单验签失败，请联系对应管理人员。',
        self::ERR_ORDER_OFFLINE_PRICE_ERROR => '离线订单金额校验失败，请联系对应管理人员。',
        self::ERR_QUERY_TIME                => "查询时间段不能超过一个月",

        self::ERR_POS_OFFLINE_STATUS           => '门店小程序不可下单，请联系门店是否营业。',
        self::ERR_ORDER_CANCEL_STATUS          => '当前订单状态不支持此操作',
        self::ERR_ORDER_CALL_PAY               => '当前订单未唤起小程序支付，暂不能发起取消订单操作',
        self::ERR_ORDER_NO_ENOUGH_GIFT_PRODUCT => '当前订单赠品库存不足'
    ];
}
